﻿using ApplicationLibrary.SqlConnector;
using System;

namespace Clothes.Sales.ModuleData
{
    #region CL_Sales
    public class CL_Sales : Table
    {
        public static string Name = "CL_Sales";

        public static Column<SalesType> SaledocType = new Column<SalesType>(Name, "", "SalesType", 2, false, false);
        public static Column<string> DocumentNo = new Column<string>(Name, Properties.Resources.T_DocumentNo, "DocumentNo", LEN.LONG_CODE, false, false);
        public static Column<DateTime> ReleaseDate = new Column<DateTime>(Name, Properties.Resources.T_ReleaseDate, "ReleaseDate");
        public static Column<int> CustID = new Column<int>(Name, "", "CustID");
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.BIG_DESCRIPTION);
        public static Column<string> Address = new Column<string>(Name, "", "Address", 128);
        public static Column<string> ZipCode = new Column<string>(Name, "", "ZipCode", 5);
        public static Column<string> City = new Column<string>(Name, "", "City", 35);
        public static Column<string> County = new Column<string>(Name, "", "County", 2);
        public static Column<string> FiscalCode = new Column<string>(Name, "", "FiscalCode", LEN.CODE);
        public static Column<bool> Printed = new Column<bool>(Name, "", "Printed");

        public override iColumn ForeignKey
        {
            get { return DocumentNo; }
        }

        public CL_Sales()
        {
            VisibleInRadar(new iColumn[] { SaledocType, DocumentNo, ReleaseDate, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { SaledocType, DocumentNo });
        }
    }
    #endregion
    #region CL_SalesDetail
    public class CL_SalesDetail : Table
    {
        public static string Name = "CL_SalesDetail";

        public static Column<SalesType> SaledocType = new Column<SalesType>(Name, "", "SalesType", 2, false, false);
        public static Column<string> DocumentNo = new Column<string>(Name, Properties.Resources.T_DocumentNo, "DocumentNo", LEN.LONG_CODE, false, false);
        public static Column<int> Line = new Column<int>(Name, "", "Line", false, false);
        public static Column<int> ItemID = new Column<int>(Name, "", "ItemID");
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.BIG_DESCRIPTION, true);
        public static Column<double> Price = new Column<double>(Name, "", "Price");

        public override iColumn ForeignKey
        {
            get { return DocumentNo; }
        }

        public CL_SalesDetail()
        {
            VisibleInRadar(new iColumn[] { SaledocType, DocumentNo });
            Tablename = Name;
            DefineKey(new iColumn[] { SaledocType, DocumentNo, Line });
        }
    }
    #endregion

    #region CL_CounterSales
    public class CL_CounterSales : Table
    {
        public static string Name = "CL_CounterSales";

        public static Column<string> DocumentNo = new Column<string>(Name, Properties.Resources.T_DocumentNo, "DocumentNo", LEN.LONG_CODE, false, false);
        public static Column<DateTime> ReleaseDate = new Column<DateTime>(Name, Properties.Resources.T_ReleaseDate, "ReleaseDate");
        public static Column<int> CustID = new Column<int>(Name, "", "CustID");

        public override iColumn ForeignKey
        {
            get { return DocumentNo; }
        }

        public CL_CounterSales()
        {
            VisibleInRadar(new iColumn[] { DocumentNo, ReleaseDate });
            Tablename = Name;
            DefineKey(new iColumn[] { DocumentNo });
        }
    }
    #endregion

    #region CL_CounterSalesDetail
    public class CL_CounterSalesDetail : Table
    {
        public static string Name = "CL_CounterSalesDetail";

        public static Column<string> DocumentNo = new Column<string>(Name, Properties.Resources.T_DocumentNo, "DocumentNo", LEN.LONG_CODE, false, false);
        public static Column<int> Line = new Column<int>(Name, "", "Line", false, false);
        public static Column<int> ItemID = new Column<int>(Name, "", "ItemID");
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.BIG_DESCRIPTION, true);
        public static Column<double> Price = new Column<double>(Name, "", "Price");

        public override iColumn ForeignKey
        {
            get { return DocumentNo; }
        }

        public CL_CounterSalesDetail()
        {
            VisibleInRadar(new iColumn[] { DocumentNo });
            Tablename = Name;
            DefineKey(new iColumn[] { DocumentNo, Line });
        }
    }
    #endregion
}



